package ooday02;
/*子类*/
public class Student extends Person {
    String className;
    String stuId;

//    int age;//演示和父类同名辨别this和super

    //无参
    Student(){
    }
    //有参
    Student(String name,int age,String address,String className,String stuId){
        super(name,age,address);//传递的是name/age/address变量的值

//        this.name  =name;
//        this.age = age;//此处的this 是就近原则，指代自己的
//        super.age = age;//此处的super age是父类的age
 //       this.address =address;

        this.className =className;
        this.stuId = stuId;

    }
    //方法
    void study(){
        System.out.println(name+"正在学习....");
    }
    void sayHi(){//学生重写
        System.out.println("我叫"+name+",今年："+age+"岁了，家住"+address
                           +",学号是"+stuId+",班级是："+className);

    }


}
